package tester;
import actions.*;
import filters.*;
import java.io.*;

import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class tester {
	
	public static class setLogic {
		
		public static TreeSet<File> LogicalOR(TreeSet<File> setA,TreeSet<File> setB) {
			TreeSet<File> _tmpSet = new TreeSet<File>(setA);
			_tmpSet.addAll(setB);
			return _tmpSet;
		}
		
		public static TreeSet<File> LogicalNOT(TreeSet<File> globalSet,TreeSet<File> set) {
			TreeSet<File> _tmpSet = new TreeSet<File>(globalSet);
			for(Iterator<File> it1=set.iterator();it1.hasNext();) {
				_tmpSet.remove(it1.next());
			}
			return _tmpSet;
		}
	}
	
	
	public static void addFileToTreeSet(TreeSet<File> ts,File file) {
		File[] _filesInDir = file.listFiles();
		for(int i=0;i<_filesInDir.length;i++) {
			if(_filesInDir[i].isDirectory()) {
				addFileToTreeSet(ts,_filesInDir[i]);
			} else {
				ts.add(_filesInDir[i]);
			}
		}
	}
	
	public static TreeSet<File> readDirectory(String path) {
		TreeSet<File> ts = new TreeSet<File>();
		File _dirPath = new File(path);
		addFileToTreeSet(ts,_dirPath);
		return ts;
	}
	
	
	public static void main(String[] args) throws ParseException{
		File file = new File("C:\\DRIVERS\\install.log");
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy//dd//MM");
		Date filedate = new Date(file.lastModified());
		Date incomingDate = sdf.parse("2006//22//05");
		if(filedate.compareTo(incomingDate)>0) {
			System.out.println("Im before you");
		}
		
	}
}
